﻿using FluentValidation;
using Nop.Admin.Models.XJ;
using Nop.Core.Domain.XJ;
using Nop.Data;
using Nop.Web.Framework.Validators;

namespace Nop.Admin.Validators.XJ
{
	public partial class InspectionPlanValidator : BaseNopValidator<InspectionPlanModel>
	{
		public InspectionPlanValidator(IDbContext dbContext)
		{
			RuleFor(x => x.TeamId).GreaterThan(0).WithMessage("巡检班组不能为空");
			RuleFor(x => x.MaintenanceTeamId).GreaterThan(0).WithMessage("维修班组不能为空");

			SetDatabaseValidationRules<XJInspectionPlan>(dbContext);
		}
	}
}